package happyhouse.views;

import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.IToolBarManager;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.part.ViewPart;
import org.eclipse.swt.widgets.Table;
import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.jface.layout.TableColumnLayout;
import org.eclipse.swt.layout.FormAttachment;
import org.eclipse.swt.layout.FormLayout;
import org.eclipse.swt.layout.FormData;
import org.eclipse.swt.widgets.Button;

public class InCome extends ViewPart {

	public static final String ID = "happyhouse.views.InCome"; //$NON-NLS-1$
	private Table table;

	public InCome() {
	}

	/**
	 * Create contents of the view part.
	 * @param parent
	 */
	@Override
	public void createPartControl(Composite parent) {
		Composite container = new Composite(parent, SWT.NONE);
		container.setLayout(new FormLayout());
		
		Composite composite = new Composite(container, SWT.NONE);
		composite.setBounds(124, 57, 64, 64);
		FormData fd_composite = new FormData();
		fd_composite.bottom = new FormAttachment(0, 337);
		fd_composite.right = new FormAttachment(0, 567);
		fd_composite.top = new FormAttachment(0, 57);
		fd_composite.left = new FormAttachment(0, 124);
		composite.setLayoutData(fd_composite);
		composite.setLayout(new TableColumnLayout());
		
		TableViewer tableViewer = new TableViewer(composite, SWT.BORDER | SWT.FULL_SELECTION);
		table = tableViewer.getTable();
		table.setHeaderVisible(true);
		table.setLinesVisible(true);
		
		Button btnNhpDLiu = new Button(container, SWT.NONE);
		FormData fd_btnNhpDLiu = new FormData();
		fd_btnNhpDLiu.right = new FormAttachment(0, 102);
		fd_btnNhpDLiu.left = new FormAttachment(0, 10);
		btnNhpDLiu.setLayoutData(fd_btnNhpDLiu);
		btnNhpDLiu.setText("Nh\u1EADp d\u1EEF li\u1EC7u");
		
		Button btnXemDLiu = new Button(container, SWT.NONE);
		fd_btnNhpDLiu.bottom = new FormAttachment(btnXemDLiu, -5);
		FormData fd_btnXemDLiu = new FormData();
		fd_btnXemDLiu.top = new FormAttachment(0, 85);
		fd_btnXemDLiu.right = new FormAttachment(0, 101);
		fd_btnXemDLiu.left = new FormAttachment(0, 11);
		btnXemDLiu.setLayoutData(fd_btnXemDLiu);
		btnXemDLiu.setText("Xem d\u1EEF li\u1EC7u");

		createActions();
		initializeToolBar();
		initializeMenu();
	}

	/**
	 * Create the actions.
	 */
	private void createActions() {
		// Create the actions
	}

	/**
	 * Initialize the toolbar.
	 */
	private void initializeToolBar() {
		IToolBarManager toolbarManager = getViewSite().getActionBars()
				.getToolBarManager();
	}

	/**
	 * Initialize the menu.
	 */
	private void initializeMenu() {
		IMenuManager menuManager = getViewSite().getActionBars()
				.getMenuManager();
	}

	@Override
	public void setFocus() {
		// Set the focus
	}
}
